<?php

Yii::import('application.models._base.BaseRegion');

class Region extends BaseRegion
{
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}

    public function getCity($pid){
        $info = Yii::app()->db->createCommand()
            ->from('{{region}}')
            ->where('pid=:pid and type=:type', array(':pid'=>$pid,':type'=>2))
            ->queryAll();
        return $info;
    }
    public function getTown($cid){
        $info = Yii::app()->db->createCommand()
            ->from('{{region}}')
            ->where('pid=:pid and type=:type', array(':pid'=>$cid,':type'=>3))
            ->queryAll();
        return $info;
    }

}